

package com.hazelcast.config;

/**
 * Commons for split brain protection config builders.
 */
public abstract class SplitBrainProtectionConfigBuilder {

    /**
     * The minimum cluster size: expected number of live members in cluster not to be considered it split
     */
    protected int minimumClusterSize;

    /**
     * Whether this split brain protection config is enabled or not
     */
    protected boolean enabled = true;

    public SplitBrainProtectionConfigBuilder enabled(boolean enabled) {
        this.enabled = enabled;
        return this;
    }

    public SplitBrainProtectionConfigBuilder withSplitBrainProtectionSize(int minimumClusterSize) {
        this.minimumClusterSize = minimumClusterSize;
        return this;
    }

    public abstract SplitBrainProtectionConfig build();

}
